Skip to content

fix HttpServer::loop idx iteration exception#726

Merged
ithewei merged 1 commit into
ithewei:masterfrom
House-Men:patch-8
Apr 17, 2025
Merged

fix HttpServer::loop idx iteration exception#726
ithewei merged 1 commit into
ithewei:masterfrom
House-Men:patch-8

Conversation

@House-Men
Copy link
Copy Markdown
Contributor

@House-Men House-Men commented Apr 17, 2025

for (int idx = 0; ; ++idx) {
    loop = m_server.loop(idx);
    if (!loop) break;
    ....
}

类似上述迭代获取loop会在非loop线程内不会死循环,在loop线程内死循环,而多进程模式也不好计算privdata->loops内部私有数组实际数量,不同线程环境行为不一致和idx语义有歧义所以调整了超出idx最大范围时返回NULL

@House-Men House-Men changed the title HttpServer::loop idx iteration exception fix HttpServer::loop idx iteration exception Apr 17, 2025
@ithewei ithewei merged commit 05bd1ca into ithewei:master Apr 17, 2025
6 checks passed
@House-Men House-Men deleted the patch-8 branch April 17, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants